import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import '../style/less/main.css';
import axios from '../api/index';
import {Button ,mountNode } from 'antd';
import { createStore } from 'redux';
import { Provider, connect } from 'react-redux';
import actions from '../actions/index';
 import {reducer} from '../reducers/index';
 let store = createStore(reducer);

class AddToDo3 extends React.Component{
    constructor(props){
        super(props)
    }
    
    render(){
        return(
            <div>
                <h2>redux传值</h2>
                <div>{this.props.text}</div>
            </div>
           )
    }
}
const mapStateToProps = (state)=>{
    return {
        text:state.text
    }
}

const mapDispatchToProps = (dispatch)=>{
    return{
        add:dispatch(actions.add),
        reduce:dispatch(actions.reduce)
    }
}



AddToDo3 = connect(mapStateToProps,mapDispatchToProps)(AddToDo3)
export default AddToDo3;